package enums;


import dictionary.Dictionary;
import dictionary.DictionaryUtils;

/**
 * 
 * 分隔符枚举
 *
 * @author:
 *		唐竹
 * @date 
 *		创建时间：2011-8-13 上午10:54:58 
 *
 */
public enum Separator implements Dictionary<Separator, String> {
	/**
	 * 英文逗号：","
	 */
	COMMA(",", ",", "英文逗号"),

	/**
	 * 竖线："|"
	 */
	VERTICAL("|", "\\|", "竖线"),

	/**
	 * 英文分号: ";"
	 */
	SEMICOLON(";", ";", "英文分号"),

	/**
	 * 与："&"
	 */
	AND("&", "&", "与"),

	/**
	 * 英文句号: "."
	 */
	PERIOD(".", "\\.", "英文句号");
	//////////////////////////////////////////////////////////

	private String code;
	private String describe;
	private String regex;

	private Separator(String code, String regex, String describe) {
		this.code = code;
		this.describe = describe;
		this.regex = regex;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return DictionaryUtils.toString(this);
	}

	public String getCode() {
		// TODO Auto-generated method stub
		return this.code;
	}

	public String getDescribe() {
		// TODO Auto-generated method stub
		return this.describe;
	}

	public Separator[] getValues() {
		// TODO Auto-generated method stub
		return values();
	}

	/**
	 * 获得该分隔符对应的正则表达式，比如“|” 的正则表达式为 “\\|”
	 */
	public String getRegex() {
		return regex;
	}

}
